package exemple;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
 
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.OneToMany;
/**
 *
 * @author Killian
 */
@Entity
@Table(name="PROCESS")
public class ProcessusB implements java.io.Serializable {
    private static final long serialVersionUID = -8757337896773261247L;
 
    private int id_process;
    private String command;
    private int pid_process;
    private String user_process;
    private double cpu_use_process;
    private double ram_use_process;
    private HistoricSystem historicSystem;

    public ProcessusB() {
    }  

    public ProcessusB(int id_process, String command, int pid_process, String user_process, double cpu_use_process, double ram_use_process) {
        this.id_process = id_process;
        this.command = command;
        this.pid_process = pid_process;
        this.user_process = user_process;
        this.cpu_use_process = cpu_use_process;
        this.ram_use_process = ram_use_process;
    }

    
    
    @Id
    @GeneratedValue
    @Column(name="ID_PROCESS")
    public int getId_process() {
        return id_process;
    }
    @Column(name="COMMAND")
    public String getCommand() {
        return command;
    }
    
    @Column(name="PID_PROCESS")
    public int getPid_process() {
        return pid_process;
    }
    @Column(name="USER_PROCESS")
    public String getUser_process() {
        return user_process;
    }
    @Column(name="CPU_USE_PROCESS")
    public double getCpu_use_process() {
        return ram_use_process;
    }
    
    @Column(name="RAM_USE_PROCESS")
    public double getRam_use_process() {
        return cpu_use_process;
    }

    public void setId_process(int id_process) {
        this.id_process = id_process;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public void setPid_process(int pid_process) {
        this.pid_process = pid_process;
    }

    public void setUser_process(String user_process) {
        this.user_process = user_process;
    }

    public void setCpu_use_process(double cpu_use_process) {
        this.cpu_use_process = cpu_use_process;
    }

    public void setRam_use_process(double ram_use_process) {
        this.ram_use_process = ram_use_process;
    }
    
    @ManyToOne
    @JoinColumn(name="id_historic")
    public HistoricSystem getHistoricSystem() {
        return historicSystem;
    }

    public void setHistoricSystem(HistoricSystem historicSystem) {
        this.historicSystem = historicSystem;
    } 

    @Override
    public String toString() {
        return "Process{" + "id_process=" + id_process + ", command=" + command + ", pid_process=" + pid_process + ", user_process=" + user_process + ", cpu_use_process=" + cpu_use_process + ", ram_use_process=" + ram_use_process + ", historicSystem=" + historicSystem + '}';
    }
    
}